package com.starsoft.smdc.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * SmdcHolidayDetail entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "smdc_holiday_detail")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE, region="ormCache")
public class SmdcHolidayDetail implements java.io.Serializable {

	// Fields

	private Integer id;
	private SmdcHoliday smdcHoliday;
	private Date specialDay;
	private Boolean isHoliday;

	// Constructors

	/** default constructor */
	public SmdcHolidayDetail() {
	}

	/** full constructor */
	public SmdcHolidayDetail(SmdcHoliday smdcHoliday, Date specialDay, Boolean isHoliday) {
		this.smdcHoliday = smdcHoliday;
		this.specialDay = specialDay;
		this.isHoliday = isHoliday;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "code")
	public SmdcHoliday getSmdcHoliday() {
		return this.smdcHoliday;
	}

	public void setSmdcHoliday(SmdcHoliday smdcHoliday) {
		this.smdcHoliday = smdcHoliday;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "special_day", length = 10)
	public Date getSpecialDay() {
		return this.specialDay;
	}

	public void setSpecialDay(Date specialDay) {
		this.specialDay = specialDay;
	}

	@Column(name = "is_holiday")
	public Boolean getIsHoliday() {
		return this.isHoliday;
	}

	public void setIsHoliday(Boolean isHoliday) {
		this.isHoliday = isHoliday;
	}

}